<template>
  <el-container style="height: auto; border: 1px solid #eee">
    <el-aside width="200px" style="background-color: rgb(238, 241, 246)">
      <el-menu :default-openeds="['1', '3']">
        <el-submenu index="1">
          <el-menu-item index="1-1" @click="zhaopin">招聘管理</el-menu-item>
          <el-menu-item index="1-2" @click="yonghu">用户信息</el-menu-item>
          <el-menu-item index="1-3" @click="chanpin">产品视频管理</el-menu-item>
          <el-menu-item index="1-4" @click="zixun">资讯管理</el-menu-item>
          <el-menu-item index="1-5" @click="pclunbo">pc首页轮播图</el-menu-item>
          <el-menu-item index="1-6" @click="faxian">首页发现视频</el-menu-item>
          <el-menu-item index="1-7" @click="guanyuwomen">关于我们视频</el-menu-item>
        </el-submenu>
      </el-menu>
    </el-aside>

    <el-container>
      <el-header style="text-align: right; font-size: 12px">
        <el-dropdown>
          <i class="el-icon-setting" style="margin-right: 15px"></i>
          <template #dropdown>
            <el-dropdown-menu>
              <el-dropdown-item @click="editpwd">修改密码</el-dropdown-item>
              <el-dropdown-item @click="logon">退出登陆</el-dropdown-item>
            </el-dropdown-menu>
          </template>
        </el-dropdown>
        <span>管理员</span>
      </el-header>

      <el-main class="el-main" style="overflow: hidden;">
        <router-view :jwttoken="jwttoken" v-on:loginstate1="abc"/>
      </el-main>
    </el-container>
  </el-container>
</template>
<style>
el-container {
  overflow: hidden;
}

.el-header {
  background-color: #b3c0d1;
  color: #333;
  line-height: 60px;
}

.el-aside {
  color: #333;
  overflow: hidden;
}

.el-main {
  overflow: hidden;
}
</style>

<script>
export default {
  props: ['jwttoken'],
  data() {
    return {}
  },
  watch: {},
  methods: {
    zhaopin: function () {
      this.$router.push("/ZhaoPinList");
    },
    yonghu: function () {
      this.$router.push("/UserLianXiList");
    },
    chanpin: function () {
      this.$router.push("/ProductVideoList");
    },
    abc: function (loginstate1) {
      console.log(loginstate1)
      this.$emit('loginstate1', loginstate1);
    },
    editpwd: function () {
      this.$router.push("/editpwd")
    },
    zixun: function () {
      this.$router.push("/zixun")
    },
    pclunbo: function () {
      this.$router.push("/pclunbo")
    },
    faxian: function () {
      this.$router.push("/faxian")
    },
    guanyuwomen: function () {
      this.$router.push("/about")
    },
    logon:function (){
      window.localStorage.clear()
      location.reload()
    }
  },
  created: function () {
    console.log(this)
  }
};
</script>
